package com.ripple.java8.example;

import com.ripple.client.Client;
import com.ripple.client.requests.Request;
import com.ripple.client.responses.Response;
import com.ripple.client.transport.impl.JavaWebSocketTransportImpl;
import com.ripple.core.coretypes.hash.Hash256;
import com.ripple.core.types.known.tx.result.TransactionResult;
import org.json.JSONException;

/**
 * @author xinj.x
 */
public class QueryAcctTxn {
    public static void main(String[] args) {
        Client client = new Client(new JavaWebSocketTransportImpl())
                .connect("wss://s.altnet.rippletest.net:51233");

        client.requestTransaction(Hash256.fromHex("E7D94ABE617FFCD5EF15F352EC1EA0997DACF0FBEDE5B375A453338370A938BE"),
                new Request.Manager<TransactionResult>() {
                    @Override
                    public void cb(Response response, TransactionResult transactionResult) throws JSONException {
                        System.out.println(transactionResult);
                    }
                });

    }
}
